<script type="text/javascript">
function saveCommentImages(form, evt) {
	new Event(evt).stop();
	form = $(form);
		form.set('send', {url:'<?php echo site_url(array('project','saveCommentImages',$this->uri->segment(4,0)))?>',method :'post',
		 	onSuccess: function(responseText, responseXML){
//				box_images.close();
				showCommentImages();
				$('commentImages').set('value','');
			},
			onComplete: function(){
				
			},
			onFailure: function(xhr){
				failure();
			}
		});
		form.send();
	
	return false;
}
function showCommentImages(){
	var myRequest = new Request({
		url: '<?php echo site_url(array("project","showCommentImages",$row->id_images))?>',
		method: 'post',
		onSuccess : function(responseText){
			$('showCommentImages').innerHTML = responseText;
		}
	}).send();
}
window.addEvent('domready',function(){
//	detileShowImages();
	showCommentImages();
	new FormCheck('formCommentImages', {
		display : {
			errorsLocation : 1,
			showErrors : 1,
			addClassErrorToField : 1
		}
	});
});
</script>

<?php 
$temp = "#EFEFEF";
foreach ($query->result() as $row):
	if($row->thumbs=="" || $row->thumbs==false){
		$row->thumbs = "images/nopicture.jpg";
	} else {
		$que = $this->db->query("select thumbs from images where id_images='$row->id_images' limit 1");
		foreach ($que->result() as $res):
			$row->thumbs = site_url(array('project','loadThumbs',$row->id_images));
		endforeach;
	}
		if($temp=='#EFEFEF'){
	 		$bg='#e0e0e0';
	 		$temp = 1;
	 	} else {
	 		$bg='#EFEFEF';
	 		$temp = 0;
	 	}
	 	$q = $this->db->query("select first_name,last_name from info where id_member='$row->id_member' limit 1");
		foreach ($q->result() as $r):
			$post = $r->first_name." ".$r->last_name;
		endforeach;
?>

<table width="575" border="0" cellpadding="1" cellspacing="0" bgcolor="#ccc">
<tr><td>	
<table width="100%" border="0" cellspacing="02" cellpadding="3" bgcolor="<?php echo $bg ?>">
  <tr>
    <td width="0" align="left" valign="top"><a href="<?php echo site_url(array('project','openImages',$row->id_album,$row->id_images))?>">
    <img src="<?php echo $row->thumbs?>" alt="<?php echo $row->name?>"class="picture" /></a></td>
    <td width="80%" align="left" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="3">
      <tr>
        <td width="20%" align="right" valign="top">Name</td>
        <td width="80%"><?php echo $row->name ?></td>
      </tr>
      <tr>
        <td align="right" valign="top">Description </td>
        <td><?php echo $row->description ?></td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        posted by <b><a href="<?php echo site_url(array('member','project',$row->id_member))?>">
        <?php echo $post?></a></b> at <?php echo $row->posted?></td>
        </tr>	
    </table></td>
  </tr>
</table>
</td></tr>
</table>
<?php 
endforeach;
?>